package com.YxyBackMange.Service.App.Impl;
import com.YxyBackMange.Entity.App.AppNews;
import com.YxyBackMange.Mapper.App.AppNewsMapper;
import com.YxyBackMange.Service.App.AppNewsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class AppNewsServiceImpl implements AppNewsService{
	
	@Autowired
    private AppNewsMapper appNewsMapper;
    
   @Override
   public AppNews insertService(AppNews appNews){
       appNews.setCreateTime(new Date());
        appNewsMapper.insertSelective(appNews);
	   return appNews;
	   
   };
   @Override
   public AppNews updateService(AppNews appNews){
	     appNewsMapper.updateByPrimaryKeySelective(appNews);
        return appNews;
   };
    @Override
    public AppNews update(AppNews appNews) {
        appNewsMapper.updateByPrimaryKeySelective(appNews);
        return appNews;
    }
   @Override
   public AppNews delete(AppNews appNews){

	     appNewsMapper.delete(appNews);
        return appNews;
   };
    @Override
    public AppNews insert(AppNews appNews){

        appNewsMapper.insertSelective(appNews);
        return appNews;

        };
}
